package sonia.drools.test;

import javax.swing.JPanel;

public class AgendaGroup extends DroolsTester{
	private JPanel a;
	private JPanel b;

	public static void main(String[] args){
		AgendaGroup test = new AgendaGroup();
		test.test();
	}

	protected JPanel createPanel(String name){
		JPanel panel = new JPanel();
		panel.setName(name);
		panel.setSize(0, 0);
		
		return panel;
	}

	@Override
	protected void addFacts() {
		a = createPanel("a");
		b = createPanel("b");
		getSession().insert(a);
		getSession().insert(b);
	}

	@Override
	protected void addRules() {
		addDrl("rules/agenda.drl");
	}

	@Override
	protected void preRun() {
		getSession().getAgenda().getAgendaGroup("group1").setFocus();
//		getSession().getAgenda().getAgendaGroup("group2").setFocus();
		getSession().getAgenda().getAgendaGroup("MAIN").setFocus();
	}
	
	@Override
	protected void postRun(){
		System.out.println(a);
		System.out.println(b);
	}
}
